<?php
class FrontNews {
	
	/**
     * @var object Zend DB Adapter
     */
    private $_db;
    /**
     * @var string
     */
   
    public function __construct()
    {
			$this->_db = Zend_Registry::get('db');
    }
	
	public function listNews($type)
    {
    	$sql = "SELECT * 
    			FROM aml_news 
    			WHERE type = '" . $type . "' AND status = 1";
    	$result = $this->_db->fetchAll($sql);
    	
    	return $result;
    }
    
    public function getNewsDetailsById($news_id, $type)
    {
    	$sql = "SELECT news_subtitle, news_sub_desc, created_date
    			FROM aml_news
    			WHERE news_id = " . $news_id . "
    			AND status = 1";
    	$result = $this->_db->fetchRow($sql);
    	
    	return $result;
    }
}
?>